The field of the invention is databases, and in particular providing an object-oriented graphical user interface through which a relational database can be manipulated.
Known graphical user interfaces to Relational Database Management Systems (xe2x80x9cRDBMSxe2x80x9d) can list of all the tables in the database. A xe2x80x9ctable,xe2x80x9d which is also called a xe2x80x9crelation,xe2x80x9d is a collection of stored records. Each record consists of one or more fields or attributes. A table is referred to with a name (table name), and each attribute (field) in a table has a name and a type. For example, a collection of records that each stores an employee identifier, an employee name and an employee age can form a table. In this example, the table is called the EMPLOYEE table. The attribute names are xe2x80x9cemployee identifier,xe2x80x9d xe2x80x9cemployee name,xe2x80x9d and xe2x80x9cemployee agexe2x80x9d. The attribute type identifies the type data that the attribute can hold (e.g. INTEGER, CHARACTER). The actual data stored in a field (e.g., John Smith or Maria Williams stored in an xe2x80x9cemployee namexe2x80x9d attribute) is called a xe2x80x9cattribute valuexe2x80x9d which is also known as xe2x80x9cdata.xe2x80x9d A record is a correlated set of stored fields. For example, a stored employee identifier correlated with a stored employee name and a stored employee age is a xe2x80x9crecord.xe2x80x9d
With RDBMS""s graphical user interface, the attributes within each table are presented to the user, and the user can manipulate (e.g., access, modify, delete) the data in the database by entering one or more commands. A command or group of commands used to manipulate data is referred to as a query. The query can concern a single table or multiple tables. One of the most popular languages for making queries is xe2x80x9cStructured Query Languagexe2x80x9d (xe2x80x9cSQLxe2x80x9d). An example of a SQL query given the above described table is:
SELECT Employee_Identifier, Employee_Name FROM EMPLOYEE WHERE Employee_Identifier greater than 1000
The above query will return a set of records including employee identifiers greater than 1000 and employee names associated with those identifiers. Information about an application is stored in a number of tables in a given database. There are guidelines to follow for distributing the information among many tables. Usually, the pieces of data that are closely related (one to one relationship, such as first name, last name, sex, social security number, and birthday) go together in a table. The database schema is a list of all the tables and their attributes.
To retrieve information which are scattered among multiple tables, an operation known as JOIN has to be performed. The JOIN operation joins together two tables on the basis of common values in a common attribute. For example, suppose the above described Employee table contains, xe2x80x9cEmployee identifierxe2x80x9d, xe2x80x9cEmployee namexe2x80x9d, and xe2x80x9cEmployee agexe2x80x9d and that a LOCATION table includes the attributes xe2x80x9cprimary employee office location,xe2x80x9d xe2x80x9csecondary employee office location,xe2x80x9d xe2x80x9cemployee telephone extension,xe2x80x9d and xe2x80x9cemployee identifierxe2x80x9d. The EMPLOYEE table can be JOINed with the LOCATION table on the shared attribute (xe2x80x9ckeyxe2x80x9d) xe2x80x9cEmployee identifierxe2x80x9d to relate an employee with his/her locations. The JOIN operation results in the attributes xe2x80x9cemployee identifierxe2x80x9d, xe2x80x9cemployee namexe2x80x9d, xe2x80x9cemployee agexe2x80x9d, xe2x80x9cprimary employee office locationxe2x80x9d, xe2x80x9csecondary employee office locationxe2x80x9d, and xe2x80x9cemployee telephone extensionxe2x80x9d. The xe2x80x9cemployee identifierxe2x80x9d is a primary key in table EMPLOYEE, in that xe2x80x9cemployee identifierxe2x80x9d uniquely identifies a row of attributes in the EMPLOYEE table. The xe2x80x9cemployee identifierxe2x80x9d is a foreign key in table LOCATION, in that it references the primary key in EMPLOYEE. Getting other information about an employee from the various tables in the RDB is a non-trivial exercise requiring the execution of many-way JOINs (JOINing multiple tables).
When a user wants to perform a multiple table query, a user often needs to have an intimate knowledge of both the database schema and a query language, e.g., SQL. Database schema can be complex. For example, in addition to the EMPLOYEE table and the LOCATION table described above, the database may include additional tables holding information about salary, employment status, employee""s education, and employee""s performance records. To perform a query, one has to know exactly how the information in one table is related to another table and what are the primary and foreign keys. Furthermore, SQL can require a substantial amount of time and effort to master. In most known systems, a user is disadvantageously required to be well acquainted with the schema of the database and the SQL language to perform even a simple query, such as determining the locations of a subset of employees. More complex operations on the database require even higher levels of knowledge and skill with SQL. This disadvantageously reduces the usefulness of a database to potential users who have neither the time nor the inclination to learn the schema and/or SQL.
In one paradigm, an entity that manipulates data is represented as an abstraction called an xe2x80x9cobject.xe2x80x9d This object-oriented paradigm is described in James Rumbaugh, Object-Oriented Modeling and Design, Prentice Hall, 1991. An object includes a description of a structure of data, ways in which the object manipulates data, and the object""s relationship with other objects. A tool (called xe2x80x9cOSPxe2x80x9d) for mapping an object model to a relational database schema is described in co-pending U.S. application Ser. No. 09/312,798, xe2x80x9cSystem and Method for Mapping a Relational Database to an Object-Oriented Paradigmxe2x80x9d, filed May 17, 1999. OSP enables an application developer to view a relational database in terms of objects, and permits the developer to manipulate the data in the database using object-oriented programming languages, such as C++. While OSP facilitates database manipulation for computer programming experts, it can be difficult to use for users who are not expert programmers, or else not programmers at all. Thus, the OSP tool alone does not address the issue of facilitating searches of relational databases by those less savvy in programming.
An embodiment of the present invention provides a graphical, object-oriented view of information stored in a relational database. An embodiment of the present invention can advantageously be published on the World Wide Web on the Internet and/or an Intranet. Users with no knowledge of a database query language or the layout of the data in the database can advantageously perform sophisticated queries with just a few mouse clicks, in accordance with an embodiment of the present invention.
In accordance with an embodiment of the present invention, an object model is mapped to a database schema, e.g., using a graphical user interface or a text editor. Mapping an object model onto a database schema means representing the relationship among the tables in the database in terms of objects. In turn the present invention provides a user friendly representation of the object model. For example, the present invention can present the object model on a web site. The web site can advantageously be deployed on the Internet, an Intranet, or even be represented only locally on a user""s computer. Having the information graphically represented as objects advantageously obviates the need to know the database schema for performing any query. An embodiment of the present invention advantageously hides the complexity of the database schema using the object model, and transparently to the user works out the details of the mapping between the object model and the database schema. In this way, a user is advantageously provided with an intuitive and easy to understand representation of the data in the database.
In an object model in accordance with an embodiment of the present invention, an object may have various traits or characteristics. For example, an object may be capable of inheriting a property from another object. For example, given the class human every object in the class can be said to inherit the properties of another class, mammal. (That is, every human is a mammal.) Additionally, an object can be made of an aggregation of other objects. For example, given the object automobile, that object can be comprised of multiple objects such as the body and engine objects. An object can also contain a collection of other objects. For example, a family object can contain a collection of children objects that is the object. An object can also be associated with another object or objects. For example, a person object may be associated with another person object through an association link such as spouse which defines a marriage tie between two persons.
Furthermore, in accordance with the present invention a user can easily perform a query on one or more objects by setting a constraint on one or more objects, and interconnecting member variables of two or more objects. The result of the query is represented in a format that is consistent with the structure of the object model.